
//添加本地存储
export const setItem = (name,value) => {
  if (typeof value === 'object') {
    value = JSON.stringify(value)
  }
 uni.setStorageSync(name,value)
}
//获取本地存储
export const getItem = name => {
  const data = uni.getStorageSync(name)
  try {
    return JSON.parse(data)
  }catch (e) {
    return data
  }
}